package org.inspursc.s0517.health.common.converter;

import org.inspursc.s0517.health.common.dto.SysOrganizationDTO;
import org.inspursc.s0517.health.common.entity.SysOrganization;
import org.inspursc.s0517.health.common.form.OrganizationForm;
import org.springframework.beans.BeanUtils;

/**
 * @author B_Dream
 * @date 2018/6/7 14:12
 */
public class OrgConverter2OrgDTO {

    public static SysOrganizationDTO converter(OrganizationForm orgForm) {
        SysOrganizationDTO org = new SysOrganizationDTO();
        BeanUtils.copyProperties(orgForm, org);
        return org;
    }

    public static SysOrganization converter(SysOrganizationDTO dto){
        SysOrganization sysOrg=new SysOrganization();
        BeanUtils.copyProperties(dto,sysOrg);
        return sysOrg;
    }

    public static SysOrganizationDTO converter(SysOrganization org){
        SysOrganizationDTO dto=new SysOrganizationDTO();
        BeanUtils.copyProperties(org,dto);
        return dto;
    }


}
